home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 5 / Apprentice-Release5.iso / Environments / RAMSES 2.2 / RAMSES 2.2 Extras / AuxLibExtra .DEF / MatWOut.DEF < prev   
Encoding:
Modula Definition  |  1996-06-21  |  2.6 KB  |  86 lines  |  [TEXT/MEDT]

  1. DEFINITION MODULE MatWOut;
  2.  
  3.   (*******************************************************************
  4.  
  5.     Module  MatWOut     (Version 1.0)
  6.  
  7.               Copyright ©1993 by Olivier Roth, Andreas Fischlin, 
  8.               and Swiss Federal Institute of Technology Zürich ETHZ 
  9.  
  10.       Purpose: Flexible textual in-/output of matrices
  11.                to windows.
  12.  
  13.       Remarks: This module is part of the Mat-library, which forms 
  14.                  part of the RAMSES package.
  15.  
  16.       Programming
  17.  
  18.           o Programming and Implementation
  19.               O. Roth                 14.11.89
  20.               A. Fischlin            28/Mai/93
  21.               
  22.           Systems Ecology Group
  23.           Swiss Federal Institute of Technology Zurich ETHZ
  24.           Department of Environmental Sciences
  25.           Grabenstr. 3
  26.           CH-8952 Schlieren/Zurich
  27.           Switzerland
  28.  
  29.           Last revision of definition:  1/Jun/93 af
  30.  
  31.   *******************************************************************)
  32.  
  33.   FROM DMConversions IMPORT RealFormat;
  34.  
  35.   FROM Matrices IMPORT Matrix;
  36.  
  37.  
  38.  
  39.   TYPE
  40.     MatFormat = RECORD
  41.       realF    : RealFormat;
  42.       len, dec : CARDINAL;
  43.       separator: ARRAY[0..63] OF CHAR;
  44.       crCol    : INTEGER;
  45.       eOM      : ARRAY[0..63] OF CHAR;
  46.     END(*RECORD*);
  47.  
  48.  (* MatFormat describes the format in which a matrix will be written
  49.   * to the current output window of the 'Dialog Machine'.  "realF" 
  50.   * will be applied to every number, "len" stands for the length of 
  51.   * the field for the real number (including decimal digits and 
  52.   * point), "dec" stands for the number of decimal digits, 
  53.   * "separator" is a string which is written after each matrix 
  54.   * element except at the end of a line (cr), and "crCol" specifies 
  55.   * the matrix column after which a carriage return (cr) is 
  56.   * inserted. If "crCol"is negative or 0 the matrix's number of 
  57.   * columns is taken.  "eOM" stands for 'end of matrix' and may 
  58.   * contain any string which is written after the matrix' elements 
  59.   * have been written. *) 
  60.   
  61.   
  62.   VAR
  63.     standardO : MatFormat; (* read only var!!!
  64.                               is set to: fix, 10, 3, <tab>, 0, "EOM"<cr> *)
  65.  
  66.  
  67.   PROCEDURE SetMatFormat (     mf: MatFormat );
  68.   PROCEDURE GetMatFormat ( VAR mf: MatFormat );
  69.   (* Sets the MatFormat to be used for all subsequent writing 
  70.      routines. The default format is standardO. *) 
  71.  
  72.  
  73.  
  74.   PROCEDURE WriteMatrix( m: Matrix );
  75.  
  76.   PROCEDURE WriteRow   ( m: Matrix; rowNr: INTEGER );
  77.  
  78.   PROCEDURE WriteCol   ( m: Matrix; colNr: INTEGER );
  79.  
  80.   PROCEDURE WriteEle   ( m: Matrix; row,col:INTEGER );
  81.  
  82.   (* All writing routines use routines from DMWindIO *)
  83.   
  84.  
  85. END MatWOut.